#pragma once
#include <algorithm>
#include <map>
#include <set>
#include <BWAPI\Position.h>
#include <BWAPI\UnitType.h>
#include <AgentePrincipal.h>
using namespace std;
typedef pair<int,int> Ponto;
#define mp make_pair
#define X first
#define Y second
#define SETI set<Unidade*>::iterator
#define PROBE BWAPI::UnitTypes::Protoss_Probe
typedef BWAPI::Position Position;
typedef pair<BWAPI::Position,double> Par;
typedef BWAPI::UnitType TYPE;


class PlaceChooser
{
	map<Ponto,int> Constructions;
	map<Ponto,int> Grid;
	vector<Ponto> Pts;
	Ponto Base;
	bool Initialized;

	bool TryConstruct(Ponto Cell, Unidade* Worker, TYPE Buiding);
public:
	int SIZE;

	void MakeConstruction(Unidade* Worker, TYPE Building);
	void Update(set<Unidade*> Units);
	void Init(Unidade* base, int Size);
	PlaceChooser();
	~PlaceChooser(void);
};
